package org.example.utils;

public enum AuthCode {
    /**
     * auth_public (90000~99999)
     */
    AUTH_SUCCESS(true,90000,"成功"),
    AUTH_ERROR_CODE(false,90002,"验证码有误"),
    AUTH_ERROR_SYSTEM(false,99999,"系统繁忙，请稍后再试"),


    /**
     * auth_login  (10000~10019)
     */
    AUTH_LOGIN_SUCCESS(true,10000,"登陆成功"),
    AUTH_LOGIN_ERROR(false,10010,"登陆失败"),
    AUTH_LOGIN_ERROR_PWD(false,10011,"登录密码有误"),
    AUTH_LOGIN_ERROR_SYSTEM(false,10012,"登录繁忙，请稍后再试"),
    AUTH_LOGIN_ERROR_NOT_USER(false,10013,"不存在该用户，请先注册"),
    /**
     * auth_register   (10020~10039)
     */
    AUTH_REGISTER_SUCCESS(true,10020,"恭喜您，注册成功"),
    AUTH_REGISTER_ERROR(false,10030,"注册失败"),
    AUTH_REGISTER_ERROR_EXISTS_USER(false,10031,"已存在该用户"),
    /**
     * auth_code     (10040~10059)
     */
    AUTH_CODE_GET_SUCCESS(true,10040,"验证码获取成功"),
    AUTH_CODE_SUCCESS(true,10041,"验证成功"),
    AUTH_CODE_GET_ERROR(false,10050,"验证码获取异常，请稍后再试"),
    /**
     * auth_token     (10060~10079)
     */
    AUTH_TOKEN_SUCCESS(true,10060,"令牌校验成功"),
    AUTH_TOKEN_ERROR(false,10070,"令牌校验失败");


    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    public boolean success() {
        return success;
    }
    public int code() {
        return code;
    }
    public String message() {
        return message;
    }

    AuthCode(boolean success,int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }
}
